package com.example.administrator.reader.utils;

import android.app.Activity;
import android.content.Context;
import android.graphics.Rect;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.Window;

/**
 * Created by Administrator on 2016-09-04.
 */
public class UIUtils {

    public static Context getContext() {
        return BaseApplication.getApplication();
    }

    public static int getScreenWidth(Activity activity) {
        Rect rect = new Rect();
        activity.getWindow().getDecorView().getWindowVisibleDisplayFrame(rect);
        return rect.width();

    }

    public static int getScreenHeight(Activity activity) {

        Rect rect = new Rect();
        activity.getWindow().getDecorView().getWindowVisibleDisplayFrame(rect);
        return rect.height();

    }
}
